﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.FileProviders;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Fierce.MvcExtend
{
    public static class StaticFileProvider
    {
        public static StaticFileOptions CreateOptions(string folder, string requestPath)
        {
            StaticFileOptions sfo = new StaticFileOptions();

            string root = Path.Combine(Directory.GetCurrentDirectory(), folder);

            sfo.FileProvider = new PhysicalFileProvider(root);

            sfo.RequestPath = requestPath; return sfo;
        }
    }
}